<?php
require_once (JPATH_LIBRARIES . DS . 'lib-soap' . DS . 'nusoap.php');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla controller library
jimport('joomla.application.component.controller');

/**
 * FAQ Book Component Controller
 */
class PimControllerPim extends JController {

    var $Itemid = "";

    function __construct() {
        parent::__construct();
      
        $this->Itemid = JRequest::getVar('Itemid');
        
        // Create the server instance
		$server = new soap_server;
        $server->soap_defencoding = 'UTF-8';
		$server->decode_utf8 = false;
		$server->register('getproduct');
		
		// create HTTP listener
		$request = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
		$server->service($request);
		
		var_dump($server);
		die;
    }

    public function display() {
        parent::display();
    }
	
    function getproduct($id=0){
    	$array = array("1" => "111");
    	return json_decode($array);
    } 
    

    

}